package com.tools
{
	import flash.geom.Point;

	public class AreaCheck
	{
		public function AreaCheck()
		{
		}
		/**
		 *判断坐标在直线上方还是下方 
		 * @param pointArr
		 * @param p 检测的点
		 * @return int 1上0下
		 * 
		 */		
		static public function checkPos(pointArr:Array,p:Point):int{
			if(pointArr.length<2)return 0;
			var a:Number=(pointArr[1].y-pointArr[0].y)/(pointArr[1].x-pointArr[0].x);
			var b:Number=pointArr[0].y-a*pointArr[0].x;
			var y:Number=a*p.x+b;
			if(y>p.y)return 1;
			return 0;
		}
	}
}